package cn.kgc.controller;

import cn.kgc.pojo.Train;
import cn.kgc.service.TrainService;
import com.alibaba.fastjson.JSON;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author: fighting
 * @date: 2022/2/16
 * @description:
 */
@Controller

public class TrainController {

    @Resource
    private TrainService trainService;

    @RequestMapping("/培训计划")
    public String peixunjihua(Model model){

        return "培训计划";
    }

    @RequestMapping("/train/sel")
    @ResponseBody
    public String sel(){
        List<Train> list = trainService.sel();
        return JSON.toJSONStringWithDateFormat(list,"yyyy-MM-dd");
    }

    @RequestMapping("/新增培训")
    public String xinzengpeixun(){
        return "新增培训";
    }
}
